<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>扫一扫</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link href="${resources}/plugins/fontAwesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="${resources}/plugins/swiper/3.3.1/swiper.min.css" rel="stylesheet" type="text/css">
    <link href="${resources}/css/scanQrcode.css" rel="stylesheet" type="text/css">
    <script src="${resources}/plugins/jquery/2.2.2/jquery.min.js"></script>
    <script src="${resources}/js/common.js"></script>
	<script src="${resources}/plugins/wechat/jweixin-1.0.0.js"></script>
	<script src="${resources}/plugins/wechat/wechat.js?ts=2213"></script>
	    <#include "setwxshare.ftl"/>
</head>
<body>
<div id="container">
	<p style="text-align:center;color:#333;font-weight:bolder;margin-top:50px;">请扫描顾客出示的二维码，进行验证消费。
    <form method="post" action="">
        <div class="RichScan">
        <a href="javascript:void(0);" id="scan">扫一扫</a>
        </div>
    </form>
</div>
</body>

<script>

//扫一扫
var reurl=window.location.href.split('#')[0];
if(isWeixin()){
	//注册jssdk
	wx_Share('${path}',reurl,'${corpid}','${config.wxappid}',null);
	
	//扫码
	$("#scan").on("click",function(){
	
		wx.scanQRCode({
		    needResult: 1,
		    scanType: ["qrCode","barCode"], 
		    success: function (res) {
                var url = res.resultStr+"&merchantid=${merchantid}";
                window.location.href=url;
			}
       }); 
	
	})		
	
}

</script>
</html>